package com.user.basic.mapper;

import com.entity.dim.Dim;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DimMapper {

    @Insert("INSERT INTO dim(id, type, name, value, status, create_time, comment) " +
            "VALUES (#{id}, #{type}, #{name}, #{value}, #{status}, #{createTime}, #{comment})")
    void save(Dim dim);

    @Select("SELECT name, value FROM dim WHERE type = #{type} AND status = #{status}")
    List<Dim> selectByTypeAndStatus(int type, byte status);
}
